var webpack = require("webpack");
const path = require("path");

module.exports = {
    devServer: {
        host: "0.0.0.0",
        port: 999,
        historyApiFallback: true,
        allowedHosts: "all",
        proxy: {
            "/api": {
                target: "http://101.43.39.107:5000",
                changeOrigin: true,
                ws: false,
                pathRewrite: {
                    "^/api": "/api",
                },
            },
        },
    },
    css: {
        loaderOptions: {
            stylus: {
                "resolve url": true,
                import: ["./src/theme"],
            },
            sass: {
                additionalData: `@import "@/styles/_variables.scss";`,
            },
        },
    },
    // plugins: {},
    pluginOptions: {
        "cube-ui": {
            postCompile: true,
            theme: true,
        },
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                "window.Quill": "quill/dist/quill.js",
                Quill: "quill/dist/quill.js",
            }),
        ],
        resolve: {
            alias: {
                "@": path.resolve(__dirname, "src"), // 将@配置为src目录的绝对路径
            },
        },
    },
};